/* 新增：CSS重置 */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
/* 新增样式 */
.header-buttons {
    display: flex;
    gap: 10px;
}

#history-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.history-list {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 15px;
}

.history-item {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.history-info {
    flex: 1;
}

.history-date {
    font-weight: bold;
    color: #333;
}

.history-duration {
    font-size: 0.9em;
    color: #666;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
}

.btn-play {
    color: #4CAF50;
}

.btn-delete {
    color: #F44336;
}

#audio-player {
    width: 100%;
    margin-top: 15px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-close-panel {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.history-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

#history-filter {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.btn-danger {
    background-color: #F44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch input[type="checkbox"] {
    position: relative;
    width: 50px;
    height: 24px;
    -webkit-appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 12px;
    transition: .3s;
    cursor: pointer;
}

.toggle-switch input:checked[type="checkbox"] {
    background: #4CAF50;
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: white;
    transition: .3s;
}

.toggle-switch input:checked[type="checkbox"]::before {
    left: calc(100% - 22px);
}

.recording-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* 响应式调整 */
@media (max-width: 500px) {
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .history-actions {
        align-self: flex-end;
        margin-top: 8px;
    }
    
    .recording-actions {
        flex-wrap: wrap;
    }
    
    .recording-actions button {
        flex: 1;
    }
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.toast.fade-out {
    opacity: 0;
}

.particle {
    position: absolute;
    background-size: cover;
    pointer-events: none;
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(0, -200px);
        opacity: 0;
    }
}